package com.jeasonzhao.commons.db;

public class SqlParameterStatus
{
    public static final SqlParameterStatus Default = new SqlParameterStatus(ParameterUsage.Madantory,null);
    private ParameterUsage usage = null;
    private java.util.List<Object> values = null;
    private boolean singleSelect = false;
    public SqlParameterStatus()
    {
    }

    public SqlParameterStatus(ParameterUsage u,java.util.List<Object> v,boolean singleS)
    {
        this.usage = u;
        this.values = v;
        this.singleSelect = singleS;
    }

    public SqlParameterStatus(ParameterUsage u,java.util.List<Object> v)
    {
        this.usage = u;
        this.values = v;
    }

    public SqlParameterStatus(ParameterUsage u)
    {
        this.usage = u;
    }

    public ParameterUsage getUsage()
    {
        return usage;
    }

    public java.util.List<Object> getValues()
    {
        return values;
    }

    public boolean isSingleSelect()
    {
        return singleSelect;
    }

    public void setUsage(ParameterUsage usage)
    {
        this.usage = usage;
    }

    public void setSingleSelect(boolean singleSelect)
    {
        this.singleSelect = singleSelect;
    }

    public void setValues(java.util.List<Object> value)
    {
        this.values = value;
    }

    public boolean hasValue()
    {
        return null != this.values && this.values.size() > 0;
    }

    public void addValue(Object ...parameters)
    {
        if(null == parameters)
        {
            return;
        }
        for(Object t : parameters)
        {
            if(null == t)
            {
                continue;
            }
            if(null == this.values)
            {
                this.values = new java.util.ArrayList<Object>();
            }
            this.values.add(t);
        }
    }
}
